<jsp:include page="header.jsp" />

<div id="page-wrapper">
	<div class="container-fluid">
		<div class="row">
			<div class="col-lg-12">
			<span>
				
				<h1 class="page-header">MetaQue Bank <span class = "col-lg-offset-10">

					<a class="btn btn-primary" id="postQuestion" name="question" href="postQuestion.jsp">Post Your Question</a>

				</span></h1>
				</span>
				<ol class="breadcrumb">
					<li class="active"><i class="fa fa-dashboard"></i> Recent
						Questions</li>
				</ol>

			</div>
		</div>
		
		<div class="col-lg-10" >
		
		
			<div ng-app="">
				<div ng-controller="myController" data-ng-init="init()" id="jsController">

					<div>
						<div ng-repeat="quesList in quesList">

							<div class="col-lg-11">
						
							
								<div class="panel panel-default">
									<div class="panel-heading ">
										<h3 class="panel-title">
											<i class="fa fa-quote-left"></i> 
												<div class="pull right col-sm-offset-10">
												<div id="remove">
												  <span class="label label-default">Remove</span>
												  
												   <span class="label label-default">Close</span>
												</div>
											</div>	
											<a href="javascript:;" data-toggle="collapse" data-target="#{{quesList.qId}}">

												{{quesList.qTitle}}<i class="fa fa-quote-right"></i></a>
											
												
										</h3>
										 <br>
										<div>
											Posted By : <a class="text-left ">{{quesList.postedBy}} </a>
											<span class="badge text-right col-sm-offset-8">Posted
												on : {{quesList.qAskedDate}}</span>
										</div>


									</div>
									<div class="panel-body collapse" id="{{quesList.qId}}">
										<div>{{quesList.qBody}} QUESTION BODY HERE</div>

										<div class="text-right">
											<a href="/MetaQBank/postAnswer.jsp?qId={{quesList.qId}}&qTitle={{quesList.qTitle}}&qBody={{quesList.qBody}}">Post Your Answer <i
												class="fa fa-arrow-circle-right"></i></a>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			

		</div>
		<div class="col-lg-2">
				<div class="row">
					<div class="col-md-12">


						<div class="panel panel-default">
							<div class="panel-heading">
								<h3 class="panel-title">Question of the day</h3>
							</div>
							<div class="panel-body">
								<div class="list-group">
									<div id="dayQuestion">Question</div>
									<div id="postedBy">posted by</div>


								</div>
							</div>
						</div>
					</div>



				</div>


			</div>


	</div>

</div>
<script>
	function myController($scope, $http) {

		$http
				.get(
						"http://localhost:8080/MetaQBank/rest/question/recentQuestions")
				.success(function(response) {

					$scope.quesList = response;

				});

	}
</script>